import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-fkm',
  templateUrl: './fkm.component.html',
  styleUrls: ['./fkm.component.scss']
})
export class FkmComponent implements OnInit {

  fLetter: any = [10, 1, 1, 1, 10, 1, 1, 1, 1, 1]
  kLetter: any = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
  mLetter: any = [2, 4, 4, 4, 3, 2, 2, 2, 2, 2]

  Fltter: string = ""
  Kltter: string = ""
  Mltter: string = ""
  constructor() { }

  ngOnInit(): void {
    this.printLetter(this.fLetter)
    this.printLetter1(this.kLetter)

  }

  printLetter(layer: any) {



    let str = "";

    layer.forEach((element: any) => {
      for (let i = 0; i < element; i++) {
        str += "★"
      }
      str += "\n";
    });
    this.Fltter = str
    console.log(str)

  }
  printLetter1(layer: any) {
    let str = "";
    let length = 10

    for (let i = 0; i < length; i++) {
      for (let j = 0; j < 2; j++) {

        if (j == 0 || length / 2 - i < length / 2 + 1) {
          // console.log(length / 2 - i, length / 2 + 1);
          str += "★";
        } else if (length / 2 - i) {

        } else {
          str += "";

        }
      }
      str += "\n";
    }



    // this.Kltter = str
    console.log(str);

  }
}
